<template>
  <div>
    <el-table
    :cell-style="{padding:this.tablePadding}"
    v-loading="loading"
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="materialPrice"
        label="材料价格"
        >
      </el-table-column>
      <el-table-column
        prop="startTime"
        label="开始时间"
        >
      </el-table-column>
      <el-table-column
        prop="endTime"
        label="结束时间">
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { getMaterialPrice } from "@/api/base/material";
export default {
 data(){
     return{
         
      tableData: [],
      total: 0,
      loading: false,
      queryParams:{
        materialId:null,
        pageNum:1,
        pageSize:10
      }
     }
 },
 methods:{
   setNull(){
     this.tableData=[]
     this.total=0
     this.queryParams={
       materialId:null,
        pageNum:1,
        pageSize:10
     }
   },
    getList(){
      getMaterialPrice(this.queryParams).then((response) => {
        this.tableData = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getInfo(id) {
      this.queryParams.materialId=id
      this.getList()
    },

 }
}
</script>

<style lang="sass" scoped>

</style>>
